<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象和对象无法安全地比较</title>
</head>

<body>
    <h1>JavaScript 数字</h1>
    <p>绝对不要把数字创建为对象。</p>
    <p>数字和对象无法安全地比较。</p>
    <p id="demo"></p>
    <script>
        var x = new Number(500);
        var y = new Number(500);
        document.getElementById("demo").innerHTML = (x == y);
    </script>
</body>

</html>